using System.Globalization;
using System.Windows.Data;

namespace Koala.Pro.Helpers;

internal class DealStatusColorConverter : IValueConverter
{
    public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
    {
        if (value == null)
        {
            return "";
        }
        string result = "";
        switch (value.ToString())
        {
            case "已完成":
                result = "green";
                break;
            case "处理中":
                result = "blue";
                break;
            case "待处理":
                result = "yellow";
                break;
            case "已取消":
            case "已终止":
                result = "red";
                break;
        }
        return result;
    }

    public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
    {
        throw new NotImplementedException();
    }
}
